In an information system, the system is required to simultaneously perform a plurality of tasks, i.e., it is configured to perform multitasking. In this situation, each of the tasks is divided into various numbers of small task intervals. When a task interval of one from the tasks is performed, the task actively or passively releases system resources, such that other tasks can be performed. However, some system resources may be perpetually occupied by a particular task due to certain factors (e.g., when a program enters an infinite loop) to forcibly suspend the entire multitasking process or even crash the system. Such a phenomenon is referred to as “system resource exhaustion.”
Described below are three prior art methods for detecting whether system resources are exhausted. In a first method, a task with a lowest priority is first found, and then it is determined that system resources are exhausted when the lowest-priority task is not at all performed within a predetermined time period. Although being rather simple, the first method has the disadvantage of being unable to determine which task caused system resource exhaustion. In a second method, a logic analyzer is coupled to general purpose input/output (GPIO) pins of the system to identify a task that caused system resource exhaustion by monitoring voltage changes of the GPIO pins when tasks are performed. However, since there are multiple GPIO pins in a system, it is rather complicated to couple the GPIO pins to the logic analyzer. In a third method, a software program is used for monitoring performance of tasks when the tasks are performed to identify a task that occupies the system resources. For example, an operating system (OS) is modified to record information of each task switch. However, a disadvantage of the third method is that extra loading is added to the OS from executing additional tasks, and thus overall efficiency of the system is reduced.